package com.universal.frame.views;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Copyright © 2015 蓝色互动. All rights reserved.
 *
 * @author wujm
 * @Description 自定义GridView，解决ScrollView嵌套GridView，GridView显示不完整的问题
 * @CreateDate 2015-5-21 下午4:30:56
 * @ModifiedBy 修改人中文名或拼音缩写
 * @ModifiedDate 修改日期格式YYYY-MM-DD
 * @WhyModified 改原因描述
 */
public class WrapGridView extends GridView {

    public WrapGridView(Context context) {
        super(context);
    }

    public WrapGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public WrapGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }

}
